﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsView;

namespace WindowsFormsPresenter.AccountingObject
{
    public class AccountingObjectsPresenter : Presenter<IAccountingObjectsView>
    {
        public AccountingObjectsPresenter(IAccountingObjectsView view)
            : base(view)
        {
        }

        public void DisplayPageByBranch(int currentPage, bool isCustomer, bool isVendor, bool isEmployee)
        {
            View.AccountingObjects = Model.GetAccountingObjectsByPageAndBranch(currentPage, isCustomer, isVendor, isEmployee);
        }

        public void DisplayPageByBranchAndCategory(int currentPage, string accountingObjectCategoryId)
        {
            View.AccountingObjects = Model.GetAccountingObjectsByPageAndBranch(currentPage, accountingObjectCategoryId);
        }

        public int GetTotalPage(bool isCustomer, bool isVendor, bool isEmployee)
        {
            return Model.GetTotalPageFromAccountingObject(isCustomer, isVendor, isEmployee);
        }

        public int GetTotalPageByBranch(bool isCustomer, bool isVendor, bool isEmployee)
        {
            return Model.GetTotalPageFromAccountingObjectByBranch(isCustomer, isVendor, isEmployee);
        }

        public int GetTotalPageByCategory(string accountingObjectCategoryId)
        {
            return Model.GetTotalPageFromAccountingObjectByCategory(accountingObjectCategoryId);
        }

        public void DisplayActive(bool isCustomer, bool isVendor, bool isEmployee)
        {
            View.AccountingObjects = Model.GetAccountingObjectsActiveByBranch(isCustomer, isVendor, isEmployee);
        }
    }
}
